# -- coding: utf-8 -- 
# Name: app

from flask import Flask
import pymysql

pymysql.install_as_MySQLdb()
app = Flask(__name__)
conn = pymysql.Connect(host='127.0.0.1', port=3306, user='root', passwd='123456', db='poc', charset='utf8')
cursor = conn.cursor()
sql = "select * from mysql"
cursor.execute(sql)
results = cursor.fetchall()
for row in results:
    username = row[0]
    email = row[1]
    print(username)
cursor.close()
conn.close()


@app.route('/')
def hello_world():
    return 'hello world!'


if __name__ == '__main__':
    app.run()
